<?php 

require '../dao/gamermanagerdao.php';
session_start();
$gamerid=$_GET['gamerid'];
$dao=new gamermanagerdao();
$gamerlist=$dao->Chaxun2($gamerid);

if(empty($gamerlist)) {
	$info="用户不存在";
}


?>


<!-- 显示数据方法1 -->
<form action="../controller/handout.php?con=gamermanage&action=gamerquery2" method="post">
<label>用户名：</label>
<input type="text" name="gamerid"/>
<input type="submit"  value="查询"/>
</form>
<table class="tab">
<tr class="tabbg">
	<td >用户名</td>
    <td >经验记录</td>
	<td >金币记录</td>
</tr>
<?php if(!empty($info)){echo $info;}
 foreach ($gamerlist as $item=>$gamer){ ?>
 <tr class="tabbgg">
	<?php foreach ($gamer as $i=>$value){?>
	<td width="70px"><?php echo $value; ?></td>
	<?php } ?>
</tr>
<?php }?>
</table>
<?php 
//显示数据方法2
// if(!empty($gamerlist)){
// 	echo "<table border='1'>";
// 	foreach ($gamerlist as $item=>$gamer){
// 		echo "<tr>";
// 		foreach ($gamer as $key =>$value){
// 				echo "<td>{$value}</td>";
// 		}
// 		echo "</tr>";
// 	}
// 	echo "</table>";
// }
 ?>